// File Random.cpp
//
// Purpose: Provides random numbers as necessary
//
// Author : Bryson King
// Date : 20 March 2013
// --------------------------------------------------------------
#include "Random.h"

#include <time.h>
#include <random>

bool CRandom::m_bInitialized = false;

void CRandom::Initialize()
{
	srand((unsigned int) clock());
}

int CRandom::GetRandomNumber(const int max)
{
	// Initialize the random number generator if not already initialized
	if (!m_bInitialized)
		Initialize();

	// Generate random number between 0 and max
	return (rand() % max);
}
